package com.webdrider.servlet.action.system;

import java.util.List;

import com.common.servlet.abstracts.AbstractCronServlet;
import com.webdrider.manager.action.user.UserManager;
import com.webdrider.manager.interfaces.IUserManager;
import com.webdrider.util.SessionCacheContainer;

public class RefreshContainersServlet extends AbstractCronServlet {
	private static final long serialVersionUID = 1L;

	private IUserManager userManager = new UserManager();
	
	@Override
	public void handle() {
		List<Long> list = SessionCacheContainer.getAndDeleteExpiredSessions();
		
		try {
			for (Long id : list) {
				userManager.logout(id);
			}
		} catch (Exception exception) {
			exception.printStackTrace();
		}
	}
}
